package edu.nf.aiexam.service;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.stereotype.Service;

@Service
public class ChatService {

private final ChatClient chatClient;
    public ChatService(ChatClient.Builder chatClient) {
        this.chatClient = chatClient.build();
    }

    public String chat(String prompt) {
        return chatClient
                .prompt()
                .user("生成一个随机演员的电影记录。并使用中文  ")
                .call()
                .content();
    }
}